﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EventStandsApp
{
    public class RentedItem
    {
        //fields
        private int productId;
        private String productName;
        private double unitPrice;
        private int deposit;
        private bool isReturned;
        private int unitsInStock;
        private int howManyInOrder;
        /*Constructor*/
        public RentedItem(int productId, string name, double price, int deposit, bool isReturned, int unitsInStock)
        {
            this.productId = productId;
            this.productName = name;
            this.unitPrice = price;
            this.deposit = deposit;
            this.isReturned = isReturned;
            this.unitsInStock = unitsInStock;
            howManyInOrder = 0;
        }
        /*Getters and Setters*/
        public int HowManyInOrder
        {
            get { return this.howManyInOrder; }
            set { this.howManyInOrder = value; }
        }
        public int UnitsInStock
        {
            get { return this.unitsInStock; }
            set { this.unitsInStock = value; }
        }
        public int ProductId
        {
            get { return productId; }
        }
        public String ProductName
        {
            get { return productName; }
        }
        public double UnitPrice
        {
            get { return unitPrice; }
        }
        public int Deposit
        {
            get { return deposit; }
        }
        public bool IsReturned
        {
            get { return isReturned; }
            set
            {
                this.isReturned = value;
            }
        }
        /* Returns a string with the product id, prod name, unit price and how many units are in the order*/
        public override string ToString()
        {
            return this.productId+", "+this.productName+", "+this.unitPrice+", x"+this.howManyInOrder;//base.ToString();
        } 
    }
}
